/*
 * @author Jordi Mateo
 * @author Sergi Builtrago
 * @author Marc Gonzalez
 * @author Aitor Garcia
 * @version 23.12.2012
 */

package com.example.project;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
import android.widget.TextView;

public class Ciutat extends Activity {
	/** TODO: FIX THE FILE **/
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_historia);
		String linea = " ";
		TextView text = (TextView) findViewById(R.id.historia_text);
		text.setText("");

		try {
			InputStream fraw = getResources().openRawResource(R.raw.balaguer);

			BufferedReader brin = new BufferedReader(
					new InputStreamReader(fraw));

			while (brin.read() != -1) {
				linea = brin.readLine();
				text.append(linea);
				text.append("\n");
			}

			fraw.close();
		} catch (Exception ex) {
			Log.e("Ficheros", "Error al leer fichero desde recurso raw");
		}

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_historia, menu);
		return true;
	}

}
